﻿Public Class frmConfig

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDefineRepositorio.Click

        If frmImagem.ShowDialog = Windows.Forms.DialogResult.OK Then
            txtCaminhoImagam.Text = frmImagem.FileName
        End If

    End Sub

    Private Sub frmConfig_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        txtServidor.Text = My.Settings.DataSource
        txtDataBase.Text = My.Settings.DataBase
        txtCaminhoImagam.Text = My.Settings.Servidor_Imagens

    End Sub

    Private Sub BTNdEFINEdATAbASE_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNdEFINEdATAbASE.Click

        If frmDiretorioPadrao.ShowDialog() = Windows.Forms.DialogResult.OK Then
            txtDataBase.Text = frmDiretorioPadrao.FileName
        End If
    End Sub

    Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        With My.Settings
            
            .DataBase = txtDataBase.Text
            .Servidor_Imagens = txtCaminhoImagam.Text
            .DataSource = txtServidor.Text
            .Save()
        End With
        MsgBox("Configurações salvas com sucesso")


    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        With My.Settings
            .PKEY_Product = PKEY.Text
            .SKEY_Product = SKEY.Text
            .TKEY_Product = TKEY.Text
            .Save()
        End With
        MsgBox("Nova Chava inserida")

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
       
    End Sub
End Class